package news.service;

import news.dao.UserDao;
import news.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
@Transactional
public class UserService {
    @Autowired
    UserDao userDao;

    public List<User> userList(@RequestBody User user){
        List<User> users = userDao.userList(user);
        return users;
    }

    public void changeStatus(Integer id, Integer status) {
        userDao.changeStatus(id,status);
    }

    public String selectUrl(String account) {
        String url = userDao.selectUrl(account);
        return url;
    }

}
